<%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2023-04-02
  Time: 10:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" import="java.util.Date,java.text.SimpleDateFormat,java.io.Writer" language="java" %>
<html>
<head>
    <title>今天的时间</title>
    <script>
        console.log("你好");
    </script>
</head>
<body>
<%
    s6="ffff";
%>
<%-- 添加一个方法，把String转换成Date--%>
<%!
    String s6="aaaa";
    static SimpleDateFormat format=new SimpleDateFormat("yyyy年MM月dd日 h:m:s");
    public String dateToStr(Date d){
        return format.format(d);
    }
%>
   <%
       Date d=new Date();
       String s2=dateToStr(d);
       String s3=dateToStr(d);
       SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd h:m:s");
       String str=df.format(d);
       out.println(str);//Writer
       out.println("<br/>");
       out.println(out.getClass().getName());
       out.println("<br/>");
       out.println(out instanceof Writer);
   %>
<h1><%=s2%></h1>
<h1><%=s6%></h1>
<h2><%=str%></h2>

<h2><%out.write(str);%></h2>
<%--<div>
    <%=str%>
</div>--%>
   <!--
<p>
    <%=str%>
</p>
-->
</body>
</html>
